Calling splice() without a second argument removes all of the elements
after the provided index, not just one.
https://bugzilla.gnome.org/show_bug.cgi?id=698918
for (let k = 0; k < connections.length; k++) {
if (connections[k].get_uuid() == connection.get_uuid()) {
// remove the connection from the access point group
- connections.splice(k);
+ connections.splice(k, 1);
forceupdate = forceupdate || connections.length == 0;
if (forceupdate)
_connectionRemoved: function(connection) {
let pos = this._connections.indexOf(connection);
if (pos != -1)
- this._connections.splice(connection);
+ this._connections.splice(connection, 1);
let section = connection._section;